import httpServe from '@/global-services/index';
// 获取短信验证码
export const apiSmsVerifyCode = (data: any): void => httpServe.postHttp('/system/sendSms')(data);

// 获取图形验证码
export const apiImgVerifyCode = (data?: Record<string, any>): any =>
	httpServe.getHttp('/system/captcha')(data, { responseType: 'arraybuffer' });

const loginHeaders = { 'content-type': 'text/html;charset=UTF-8' };

// 加密登录
export const apiUserLogin = (data: Record<string, any>): Promise<any> =>
	httpServe.postHttp('/system/login')(data, { headers: loginHeaders });

// 重置密码
export const apiResetPassword = (data: any): void => httpServe.postHttp('/system/forgetPassword')(data, { headers: loginHeaders });

// 加密登录2
export const apiUserLogin2 = (data: Record<string, any>): Promise<any> =>
	httpServe.postHttp('/system/screenLogin')(data, { headers: loginHeaders });
